﻿<html>
<head>
<title>html转换成js</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../../images/admin.css" />
<link rel="stylesheet" type="text/css" href="../../images/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../images/icon.css" />
<script type="text/javascript" src="../../js/jquery.js"></script>
<script type="text/javascript" src="../../js/jquery.validate.js"></script>
<script type="text/javascript" src="../../js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../js/admin/admin.js"></script>

<style type="text/css">
body{margin:0}
textarea{width:760;height:180;font-size:9pt;font-family:Courier New;color:#666666}
td,body {  font-size: 14pt}
a:link{ color:#000000; text-decoration:none}
a:visited{COLOR: #000000; TEXT-DECORATION: none} 
a:active{color:green;text-decoration:none}
a:hover{color:red;text-decoration:underline}
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
  <a href="htmltojs.html">html转js</a> | <a href="jstohtml.html">js转html</a> | <a href="urlencode.html">url编码</a> <br><br><br>
  请将HTML源代码拷贝到下面表单中: <br>
  <textarea id="oSource" onpropertychange="change()" ></textarea>
  <br><br>
  下面表单中是相应的JS代码: <br />
  <textarea cols="100" id="oResult" title="双击复制" ondblclick='this.select();oResult.createTextRange().execCommand("Copy")'></textarea>  </textarea>
  <script>
 function change(){
 oResult.value="document.writeln(\""+oSource.value.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/\'/g,"\\\'").replace(/\"/g,"\\\"").split('\r\n').join("\");\ndocument.writeln(\"")+"\")"
 } </script>
</div>
</body>
</html>